home *** CD-ROM | disk | FTP | other *** search
/ One Click 11 / OneClick11.iso / Bancos de Dados / Conversao / Mysql2Excel / Setup.exe / Mysql2Excel.exe / win32com / util.pyc (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2003-06-23  |  1.3 KB  |  42 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.2)
  3.  
  4. '''General utility functions common to client and server.
  5.  
  6.   This module contains a collection of general purpose utility functions.
  7. '''
  8. import pythoncom
  9. import win32api
  10. import win32con
  11.  
  12. def IIDToInterfaceName(iid):
  13.     """Converts an IID to a string interface name.  
  14. \t
  15. \tUsed primarily for debugging purposes, this allows a cryptic IID to
  16. \tbe converted to a useful string name.  This will firstly look for interfaces
  17. \tknown (ie, registered) by pythoncom.  If not known, it will look in the
  18. \tregistry for a registered interface.
  19.  
  20. \tiid -- An IID object.
  21.  
  22. \tResult -- Always a string - either an interface name, or '<Unregistered interface>'
  23. \t"""
  24.     
  25.     try:
  26.         return pythoncom.ServerInterfaces[iid]
  27.     except KeyError:
  28.         
  29.         try:
  30.             
  31.             try:
  32.                 return win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT, 'Interface\\%s' % iid) + '(unregistered)'
  33.             except win32api.error:
  34.                 pass
  35.  
  36.         except ImportError:
  37.             pass
  38.  
  39.         return '<Unregistered interface>'
  40.  
  41.  
  42.